﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UnityEditor.Layout;

namespace UnityEditor.Controls.SceneGraphicsControl
{
    public partial class WinForm : Form
    {
        public GraphicsGame Game
        {
            set
            {
                this.graphicsDeviceControl1.Game = value;
            }
        }
        public WinForm()
        {
            this.FormBorderStyle = FormBorderStyle.None;

            InitializeComponent();

            this.InitializeTimer();
        }

        private void InitializeTimer()
        {
            System.Timers.Timer timer = new System.Timers.Timer(33);
            timer.Enabled = true;
            timer.Elapsed += new System.Timers.ElapsedEventHandler((o, e) => { this.graphicsDeviceControl1.Invalidate(); });
            timer.AutoReset = true;
            timer.Start();
        }

        private void WinForm_Resize(object sender, EventArgs e)
        {
            this.graphicsDeviceControl1.ClientSize = this.ClientSize;
        }
    }
}
